﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIA.Integration;
using VIA.Integration.Alarms;

namespace VIA.SiMoJi.Domain.Electronics
{
    public class AirSource : Automatic, IAutomatic, ISuportClearAlarm
    {
        private bool _isAirSourceError;

        [Alarm(true, AlarmLevel.Error, "气源压力报警")]
        public bool AirSourceError
        {
            get => _isAirSourceError;
            set => NotifyAlarm(ref _isAirSourceError, value);
        }
        public CardIoPoint DI08_总气源气压表 { get; set; }

        public AirSource(CardIoPoint di08_总气源气压表)
        {
            DI08_总气源气压表 = di08_总气源气压表;
        }
        public void Refresh()
        {
            if (!DI08_总气源气压表.Value)
            {
                if (_isAirSourceError) return;
                AirSourceError=true;
            }
        }
        public void ClearAlarm()
        {
            AirSourceError = false;
        }
    }
}
